import { Menu, Tray } from 'electron'
import path from 'path'
const createTray = () => {
  const tray = new Tray(
    path.resolve(
      __dirname,
      process.platform == 'darwin'
        ? '../../resources/macTrayTemplate@2x.png'
        : '../../resources/windowTray.png' 
    )
  )
  const contextMenu = Menu.buildFromTemplate([{ label: '退出', role: 'quit' }])
  
  tray.setToolTip('番茄工作时间')
  tray.setContextMenu(contextMenu)
}

export { createTray }